package sam.yao.study.user.service.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import sam.yao.study.user.model.Account;
import sam.yao.study.user.service.AccountService;

public class AccountServiceHb3Impl extends HibernateDaoSupport implements AccountService {

	public boolean isUserExist(String name) {
		boolean rtn = true;
		assert name != null : "name not null";
		assert !name.trim().equals("") : "name not empty";
		List<Account> account = (List<Account>) getHibernateTemplate().find("from Account where name=?", name);
		if (account.size() == 0) {
			rtn = false;
		}
		return rtn;
	}
}
